<script>
	export default {
		globalData: {
			config : {},
		},
		onLaunch: function(e) {
			uni.hideTabBar()
			this.setScene(e)
			this.loadConfig()
		},
		onShow: function(e) {
			this.setScene(e)
		},
		onHide: function() {
			
		},
		methods: {
			setScene(e){
				let scene = uni.getStorageSync('scene')
				let spread_id = uni.getStorageSync('spread_id')
				if(!scene && e.scene){
					uni.setStorageSync('scene',e.scene)
				}
				if(!spread_id && e.query.scene){
					let scenes = e.query.scene.split('_')
					uni.setStorageSync('spread_id',scenes[0])
					if(scenes[1]){
						this.$goto('/pages/search/detail?id='+scenes[1])
					}
				}
			},
			async loadConfig(){
				this.globalData.config = await this.$api('GET','config/create')
				if(this.globalData.callBack){
					this.globalData.callBack(this.globalData.config)
				}
			}
		}
	}
</script>

<style lang='scss'>
	@import "./static/icon.css";
	* {
		margin: 0;
		padding: 0;
		border: 0;
	}
	page {
		background: $page-color-base;
		width: 100vw;
	}
	.bigcate{
		padding: 0 15upx;
		background-color: red;
		height: 40upx;
		line-height: 40upx;
		background-image: linear-gradient(to right,#9B30FF 0%,#FF00FF 100%);
		font-size: 22upx;
		color: #fff;
		border-radius: 20upx 3upx 20upx 3upx;
	}
	/*优惠券样式*/
	.copon-view {
	    display: flex;
		.img {
		    width: 52upx;
		    height: 40upx;
		}
		.num {
			height: 40upx;
			line-height: 40upx;
		    width: 60upx;
		    border-radius: 0 8upx 8upx 0;
		    background-image: linear-gradient(90deg,#f9511f 0%,#ef1612 100%);
		    font-size: 24upx;
		    color: #fff;
		    text-align: center;
		}
	}
	/*预估赚样式*/
	.earn-view{
		height: 40upx;
		line-height: 40upx;
		padding: 0 10upx;
		font-size: 22upx;
		color: #fff;
		border-radius: 6upx;
		background: linear-gradient(to right,#fa436a,#F58C6C);
	}
	/*分享赚样式*/
	.share-view {
		height: 40upx;
		line-height: 40upx;
		border:1upx solid $uni-color-primary;
		padding: 0 10upx;
		font-size: 20upx;
		color: $uni-color-primary;
		border-radius: 20upx;
		.icon{
			padding-right: 5upx;
			font-size: 20upx;
		}
	}
	.gotop{
		position:fixed;
		bottom: 110rpx;
		right: 30rpx;
		z-index: 5;
		.gotop-btn{
			background: rgba(255,255,255,.5);
			box-shadow: 0 0 20upx 0 rgba(0,0,0,.5);
			padding: 0;
			border-radius: 50%;
			color: #666;
			width: 80upx;
			height: 80upx;
			line-height: 80upx;
			.icon{
				font-size: 36upx;
			}
		}
	}
	.empty{
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction:column;
		justify-content: center;
		align-items:center;
		text-align: center;
		font-size: 60upx;
		color: $font-color-disabled;
		.icon{
			font-size: 180upx;
		}
	}
	.placeholder {
		color: #999999;
	}
</style>
